#ifndef HISTORY_H
#define HISTORY_H

#include <QMainWindow>
#include <QTimer>
#include "qcustomplot.h"
#include <QVector>
#include <QTimer>
#include <QTime>
#include <QCoreApplication>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include <QDebug>
#include <QDateTime>
#include "mqtt/qmqtt.h"
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QFile>
#include <QJsonValue>
#include <QPainter>

namespace Ui {
class History;
}

class History : public QMainWindow
{
    Q_OBJECT

public:
    explicit History(QWidget *parent = 0);
    ~History();
    //设置qcustomplot画图属性，实时
    void setupRealtimeDataDemo(QCustomPlot *customPlot);

private slots:
    //添加实时数据槽
    void realtimeDataSlot(DOUBLE,DOUBLE);
    void query(int);
    void hisSlot(QByteArray);

private:
    Ui::History *ui;
    //定时器，周期调用realtimeDataSlot()槽，实现动态数据添加到曲线
    QTimer dataTimer;
    double value;
    QTimer *timer;
    void paintEvent(QPaintEvent * event);

signals:
    void history(QByteArray);
    void table(DOUBLE);
};

#endif // HISTORY_H
